package com.dd.common.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

@Data
@Schema(name = "IDs参数")
public class IdsDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    // 前端传参方式：前端传参使用同一个字段携带多个值，SpringBoot就会将其转换成 List 接收
    // query传参：?ids=1&ids=2&ids=3
    // body传参：{ids:[1,2,3]}
    @NotNull(message = "ids参数缺失")
    @NotEmpty(message = "ids参数不能为空数组")
    @Size(max = 100, message = "ids参数最多包含100个元素")
    @Schema(description = "ID数组", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<Long> ids;
}
